<template>
  <div class="game_cover_change">
    <form action="http://localhost:5000/files/header" method="post" enctype="multipart/form-data" style="font-size: 30px;padding: 20px" target="myIframe">
      更换头像
      <input class="person" type="file" name="file" id="gamefile" value="" multiple="multiple"/>
      用户名
      <input class="person" type="text" name="username" :value="user.username" multiple="multiple"/>
      邮箱
      <input class="person" type="text" name="email" disabled="disabled" value="1906219821@qq.com" multiple="multiple"/>
      个人介绍
      <input class="person" type="text" name="desc" :value="user.userdesc" multiple="multiple"/>
      <input class="person" v-show="false" type="text" :value="user.userid" name="userid" multiple="multiple">
      <input type="submit" class="upload-button" value="更新信息"/>
    </form>
    <iframe id="myIframe" v-show="false" name="myIframe"></iframe>
  </div>
</template>

<script>
import {mainStore} from "../../../../store";
import {storeToRefs} from 'pinia'
export default {
  name: "index",
  data(){
    const { islogin,user,token } = storeToRefs(mainStore())
    return {
      user,
      islogin,
      token,
    }
  },
  created() {
    this.updata()
  },
  methods:{
    updata(){
      const mainstore = mainStore()
      const { updatainfo } = mainstore
      updatainfo({
        userid: this.user.userid
      })
    }
  }
}
</script>

<style scoped>
.game_cover_change{
  position: relative;
  margin-top: 10px;
  width: 1500px;
  background-color: #1e3042;
  color: white;
}
.person{
  width: 800px;
  display: block;
  border: #1c2938 1px solid;
  margin: 10px 10px;
  padding: 20px;
  color: white;
  background-color: #316282;
  font-size: 24px;
}
.upload-button{
  position: absolute;
  bottom: 40px;
  right: 40px;
  font-size: 24px;
  width: 120px;
  height: 40px;
  cursor: pointer;
}
</style>
